fn main() {
    // 元组
    let tup = (1, '2', 3.4);
    println!("tup: ({}, {}, {})", tup.0, tup.1, tup.2);

    // char和str类型是不同的类型，char只有一个位码
    let mut tup = (1, "1", 3.4);
    println!("tup: ({}, {}, {})", tup.0, tup.1, tup.2);
    tup.1 = "11";
    println!("tup: ({}, {}, {})", tup.0, tup.1, tup.2);

    let tup = ();
    println!("tup: {:?}", tup);

    // 数组
    let arr = [1, 2, 3, 4, 5];
    let mut arr = [3; 5];
    println!("arr len {} first element is {}", arr.len(), arr[0]);
    arr[0] = 1;
    println!("arr len {} first element is {}", arr.len(), arr[0]);

    for e in arr {
        println!("{}", e);
    }

    // 切片，是一种引用，不具备所有权
    let a = [1, 2, 3, 4];
    // 切全部
    let b = &a[..];
    // 从头开始到i
    let c = &a[..2];
    // 从i开始到末尾
    let d = &a[1..];
    println!("a {:?}", a);
    println!("b {:?}", b);
    println!("c {:?}", c);
    println!("d {:?}", d);
}
